package com.example.basic.demos.exception;

/*自定义异常类*/
public class BusinessException extends RuntimeException {

    private final Long code;

    private final String msg;

    public BusinessException(Long code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(ErrorEnum errorEnum) {
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMsg();
    }

    public Long getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
